<?php
class NoticeAction extends PublicAction
{
    public function show()
    {
        $page = isset($_GET['p']) ? intval($_GET['p']) : 1;
        $limit = C("NOTICE_LIST_LIMIT");
        $noticeDao = D("Notice");
        $noticeCnt = $noticeDao->count();
        $noticeList = $noticeDao->limit(($page-1).",".$limit)->findAll();

       import("ORG.Util.Page");
       $pageNav = new Page($newsCnt,$limit,"");

       $this->assign("noticeList",$noticeList);
       $this->assign("pageNav", $pageNav->show());
        $this->display();
    }


    public function view()
    {
            $nid = intval($_GET["notice"]);
            if(!$nid){
                $this->redirect("show");
                return;
            }

           $noticeDao = D("Notice");
           $notice = $noticeDao->where("noticeid=$nid")->find();

           $this->assign("notice", $notice);
           $this->display();



    }
}
?>